<?php

/* ksqUrl / includes / recent.php */
/* display an example using a real shortened url */

error_reporting(0);

require_once 'config.php'; // settings
$INSTALL_PATH = INSTALL_PATH;
$APP_NAME = APP_NAME;

mysql_connect(MYSQL_HOST, MYSQL_USER, MYSQL_PASS) or die('');
		mysql_select_db(MYSQL_DB) or die('');	

$query = "SELECT id, url
FROM ".URL_TABLE." 
ORDER BY `".URL_TABLE."`.`date` DESC
LIMIT 1";

$result = mysql_query("$query");
while ($r = mysql_fetch_array($result)) {
$id = $r["id"];
$url = $r["url"];
} 

echo "<small><a href=\"$url\">$url</a></small><br/>was just shortened to <small><a href=\"$INSTALL_PATH$id\">$INSTALL_PATH$id</a></small>";

?>
